import {request} from "@@/exports";


/**
 * 添加日志
 * @param params
 */
export async function addLog(params: LogType.LogAddRequest) {
    return request<BaseResponse<boolean>>(`/log/add`, {
        method: 'POST',
        data: {...params},
        headers: {
            'Content-Type': 'application/json',
        },
    });
}

/**
 * 删除日志
 * @param id
 */
export async function deleteLog(id: number) {
    return request<BaseResponse<boolean>>(`/log/delete`, {
        method: 'POST',
        data: { id:id },
        headers: {
            'Content-Type': 'application/json',
        },
    });
}

/**
 * 获得日志信息
 * @param id
 */
export async function getLogById(id: number) {
    return request<BaseResponse<LogType.Log>>(`/log/get`, {
        method: 'GET',
        params: { id:id },
        headers: {
            'Content-Type': 'application/json',
        },
    });
}


/**
 * 分页获取日志
 * @param params
 */
export async function logQueryList(params: LogType.LogQueryRequest) {
    return request<BaseResponse<PageInfo<LogType.Log>>>(`/log/list/page`, {
        method: 'GET',
        params: { ...params },
        headers: {
            'Content-Type': 'application/json',
        },
    });
}

/**
 * 更新日志
 * @param params
 */
export async function updateLog(params: LogType.Log) {
    return request<BaseResponse<boolean>>(`/log/update`, {
        method: 'POST',
        data: { ...params },
        headers: {
            'Content-Type': 'application/json',
        },
    });
}



